<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ES7</title>
</head>
<body>
	<h3>求幂运算符（**）</h3>
	<p>Math.pow(3, 2) === 3 ** 2 === 9</p>

	<h3>查找一个数值是否在数组中</h3>
	<p>Array.prototype.includes()</p>
	
	<hr>
	<div id="console-div"></div>

	<script type="text/javascript">
	
		const log = (()=>{
			var domConsole = document.querySelector('#console-div');
			return (message)=>{
				console.log(message);
				let div = document.createElement('div');
				div.innerText = message;
				domConsole.appendChild(div);
			};	
		})();
	
		log('Math.pow(3, 2) = ' + (Math.pow(3, 2)));// 9
		log('3 ** 2 = ' + (3 ** 2));// 9
		
		log('[1, 2, 3].indexOf(3) != -1 === ' + ([1, 2, 3].indexOf(3) != -1));// true
		log('[1, 2, 3].includes(3) ===  ' + ([1, 2, 3].includes(3)));// true
	
		log('[1, 2, NaN].includes(NaN) ===  ' + ([1, 2, NaN].includes(NaN)));// true
		log('[1, 2, NaN].indexOf(NaN) ===  ' + ([1, 2, 3].includes(3)));// -1
	
	</script>
</body>
</html>